﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExBlogger.Domain.Strategy {
    class UserStrategy : IUserStrategy {
        private readonly User _user;
        private const int _maxBlogCount = 5;

        public UserStrategy(User user) {
            _user = user;
        }

        public int MaxBlogCount {
            get { return _maxBlogCount; }
        }

        public bool CanCreateBlog {
            get { return !_user.IsTransient() && _user.IsApproved && _user.Blogs.Count() < _maxBlogCount; }
        }

        public bool CanPostOnBlog {
            get { return !_user.IsTransient() && _user.IsApproved; }
        }
    }
}
